/*
 * =====================================================================================
 *
 *       Filename:  test_timeOut.cpp
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  07/04/15 23:24:46
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Andy (gk), andy_y_li@163.com
 *        Company:  RD
 *
 * =====================================================================================
 */

#include "timeOut.h"
using namespace std;

void show_time()
{
    time_t t; 
    time(&t);  // get the current time
    char *ptime = ctime(&t);    // get the time string
    cout << ptime << endl;
}

int main()
{
    show_time();
    TimeOut *t = new TimeOut(5500);
    while(true) {
        if (t->isTimeOut()) {
            break;
        }
    }
    cout << "Timeout..." << endl;
    show_time();
    return 0;
}

